home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / gtdemo.lha / gadskel.s < prev    next >
Encoding:
Text File  |  1993-09-12  |  2.6 KB  |  147 lines

  1.     section    lard,code
  2.     opt    d+,c+
  3.  
  4.     ;run with monam as it used illegal for info!
  5.  
  6. _LVOLockPubScreen    EQU    -510
  7. _LVOUnlockPubScreen    EQU    -516
  8. _LVOOpenWindowTagList    EQU    -606
  9.  
  10. CALLGAD    MACRO
  11.     move.l    _GadToolsBase,a6
  12.     jsr    _LVO\1(a6)    
  13.     ENDM
  14.  
  15. code:    include    dh0:include/system
  16.     include    libraries/gadtools.i
  17.     include    libraries/gadtools_lib.i
  18.     include    utility/tagitem.i
  19.             
  20.     Lea    GFXName,A1
  21.     Moveq    #0,D0
  22.     CALLEXEC    OpenLibrary
  23.     Move.l     D0,_GfxBase
  24.     Beq    Error
  25.  
  26.     Lea    DosName,A1
  27.     Moveq    #0,D0
  28.     CALLEXEC    OpenLibrary
  29.     Move.l     D0,_DOSBase
  30.     Beq    Error
  31.  
  32.     Lea    IntName,A1
  33.     Moveq    #0,D0
  34.     CALLEXEC    OpenLibrary
  35.     Move.l    D0,_IntuitionBase
  36.     Beq    Error
  37.  
  38.     Lea    GadToolsName,A1
  39.     Moveq    #0,D0
  40.     CALLEXEC    OpenLibrary
  41.     Move.l    D0,_GadToolsBase
  42.     Beq    Error
  43.  
  44.     *-----------------------------------------------*
  45.  
  46.     bsr    SetupScreen
  47.     bsr    OpenProject0Window    
  48.     
  49.     move.l    Project0Wnd,a0
  50.     Move.l    wd_UserPort(a0),_MyWinUserPort
  51.  
  52.     *-----------------------------------------------*
  53.  
  54. .WaitLoop    Move.l    _MyWinUserPort,A0
  55.     CALLEXEC    WaitPort
  56.     Move.l    _MyWinUserPort,A0
  57.     CALLGAD    GT_GetIMsg
  58.     Move.l    D0,A1
  59.     Move.l    im_Class(A1),D2    ;D2=IDCMP Flags Directly
  60.     Move.w    im_Code(A1),D3    ;D3=Data ie key why class=Rawkey
  61.     Move.w    im_Qualifier(A1),D4    ;D4=things like CTRL SHIFT
  62.     Move.w    im_MouseX(a1),D5    ;D5=MouseX Coordinate
  63.     Move.w    im_MouseY(a1),D6    ;D5=MouseY Coordinate
  64.     Move.l    im_IAddress(A1),D7    ;D7=Addres of Intuition Obj ie Gadget
  65.     Movem.l    D0-D7/A0-A6,-(A7)
  66.     CALLGAD    GT_ReplyIMsg
  67.     Movem.l    (a7)+,D0-D7/A0-A6
  68.  
  69.     Cmp.l    #CLOSEWINDOW,D2
  70.     beq    .exit
  71.  
  72.     cmp.l    #GADGETUP,d2
  73.     bne    .WaitLoop
  74.     
  75.     move.l    d7,a0    
  76.     cmp.l    Project0Gadgets+(0*4),d7
  77.     beq    .gad1
  78.     cmp.l    Project0Gadgets+(1*4),d7
  79.     beq    .gad2
  80.     cmp.l    Project0Gadgets+(2*4),d7
  81.     beq    .gad3
  82.     cmp.l    Project0Gadgets+(3*4),d7
  83.     beq    .gad4
  84.     bra    .WaitLoop    
  85.     
  86. .gad1    illegal
  87.     bra    .WaitLoop
  88.     
  89. .gad2    illegal
  90.     ;d3=0/1 for stake of toggle gadget
  91.     bra    .WaitLoop
  92.  
  93. .gad3    illegal
  94.     ;d3=0-3 for selected palette icon
  95.     bra    .WaitLoop
  96.  
  97. .gad4    illegal
  98.     ;d3=0-3 for selected cycle gadget
  99.     bra    .WaitLoop
  100.         
  101.     ;;;
  102.     
  103. .exit    bsr    CloseProject0Window
  104.     bsr    CloseDownScreen
  105.  
  106.     Move.l    Scr,A0
  107.     CALLINT    CloseScreen
  108.     
  109.     *-----------------------------------------------*
  110.     
  111. CloseInt    Move.l    _GadToolsBase,A1
  112.     CALLEXEC    CloseLibrary
  113.  
  114. NoGT:    Move.l    _IntuitionBase,A1
  115.     CALLEXEC    CloseLibrary
  116.  
  117.     Move.l    _DOSBase,A1
  118.     CALLEXEC    CloseLibrary
  119.  
  120.     Move.l    _GfxBase,A1
  121.     CALLEXEC    CloseLibrary
  122.  
  123.     *-------------------------------*
  124.  
  125. Error    Moveq    #0,D0
  126.     Rts
  127.  
  128.     *-------------------------------*
  129.     
  130.     include    dh0:data/pw/demo.s
  131.     
  132.     *-------------------------------*
  133.  
  134. _IntuitionBase    dc.l    0
  135. _DOSBase        dc.l    0
  136. _GfxBase        dc.l    0
  137. _GadToolsBase    dc.l    0
  138.  
  139. _MyWinUserPort    dc.l    0
  140.  
  141. GFXName        GRAFNAME
  142. IntName        INTNAME
  143. DosName        DOSNAME
  144. GadToolsName    dc.b    "gadtools.library",0
  145.         even
  146.  
  147.